Repository navigation
fix(desktop): AppImage t3 serve stops cleanly under systemd - #40624
Conversation
The AppImage t3 launcher could not be stopped as a systemd service. With the default KillMode=control-group, the stop signal reached the AppImage mount helper with the server, the mount went away while the server was still shutting down, and the server died with SIGBUS. With KillMode=mixed, the launcher shell never passed SIGTERM on, so the stop timed out and everything was SIGKILLed, leaving a dead mount. The launcher now starts the mount helper with SIGTERM ignored and unmounts it itself once the server has exited, and it runs the server in the background so it can forward TERM and HUP, keeping stdin and the server's exit status.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
EvidenceBuilt and opened each real AppImage on Linux x86_64 with systemd 255 and FUSE. Started its generated launcher in isolated user units with fresh T3 homes; waited for server readiness, then stopped it under control-group and mixed kill modes with TimeoutStopSec=30s.
Reproduction driver · Recording driver · Packaged desktop launcher installation Caveat: head still exits with status 130, so systemd reports Not shown:
|
Problem
Stopping a systemd unit that runs the Linux AppImage's generated
t3 servecan unmount the executable during shutdown and crash the server with SIGBUS. WithKillMode=mixed, the launcher alone gets the initial SIGTERM and the stop instead reaches the timeout.Change
Keep the AppImage mount alive through SIGTERM. The launcher forwards TERM and HUP to the CLI, waits for its exit, then unmounts the AppImage and returns the CLI's exit status. The mounter keeps its separate session for process-group signals.
Scope
Closes #40623. This covers the generated Linux AppImage CLI launcher and its tests. The process-group fix in #24421 is related.
Verification
Regenerated the launcher from the base and the fix and ran both against the released 0.1.11 AppImage on Linux x86_64, systemd 262 (262.1-1-arch), using isolated user units and scratch state.
control-groupmixedThe server's shutdown status is 130 in these after runs. systemd reports
result=exit-codewith the test units' default exit-status settings. The after runs show that the process exits without a core or timeout and the mount is removed.The launcher tests passed all 9 cases with Bash and dash. With the generated fix and released AppImage, terminal Ctrl-C and process-group SIGTERM each returned 130 in 0.1 s, with no core dump or mount left.
t3 --versionreturned 0 and printedt3 v0.1.11. The scopedvp run check:changedchecks passed. A rebuilt AppImage and other distributions or platforms were outside the runtime checks.Terminal captures
Terminal recording
Idle gaps are shortened. The displayed stop times are measured.
05-stop-before-after.mp4
Signal order
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
systemd-run --user --collect -p KillMode=control-group, base launchersystemd-run --user --collect -p KillMode=mixed, base launchersystemd-run --user --collect -p KillMode=control-group, target launchersystemd-run --user --collect -p KillMode=mixed, target launcher✅ **Document** - passed
✅ No issues found.
apps/desktop/src/app/DesktopCliShim.ts- Lint and format checks were not run.vpis not on PATH and node_modules has no oxlint or oxfmt binaries (dependencies likely not installed in this worktree). I did not search the machine for the tool.✅ **Push** - passed
✅ No issues found.
Produced by AI agents on behalf of the account owner. Claude Fable 5.2 in Claude Code implemented the fix and captured the runtime evidence. GPT-6.2 Sol in Codex verified and prepared the submission. Both ran through T3 Code.